﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Temas/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="Listar.aspx.cs" Inherits="Talento21.Pages.Empresa.Listar" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <legend>Empresas</legend>
    <div class="well form-inline">
        <label>
            Rut:</label>
        <asp:TextBox ID="RutTextBox" runat="server" CssClass="input-small"></asp:TextBox>
        <label>
            Razon Social:</label>
        <asp:TextBox ID="RazonSocialTextBox" runat="server" CssClass="input-small"></asp:TextBox>
        <button type="submit" class="btn">
            Buscar</button>
    </div>
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="EmpresaDataSource">
        <HeaderTemplate>
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>
                            Rut
                        </th>
                        <th>
                            Razón Social
                        </th>
                        <th>
                            Cantidad de Trabajadores
                        </th>
                        <th>
                            Correo
                        </th>
                        <th>
                            Telefono
                        </th>
                        <th>
                            Direccion
                        </th>
                        <th>
                            Adminstradores
                        </th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <a title="Editar" href="Editar.aspx?rut=<%# Eval("Emp_rut") %>&dv=<%# Eval("Dv") %>">
                        <%# Eval("Emp_rut") %>
                        -
                        <%# StringHelper.ToUpperCase(Eval("Dv")) %></a>
                </td>
                <td>
                    <%# StringHelper.ToUpperCase(Eval("RazonSocial")) %>
                </td>
                <td>
                    <%# Eval("CantTrabajadores")%>
                </td>
                <td>
                    <%# StringHelper.ToUpperCase(Eval("Correo")) %>
                </td>
                <td>
                    <%# Eval("FonoCelular")%>
                </td>
                <td>
                    <%# StringHelper.ToUpperCase(Eval("Direccion"))%>,
                    <%# StringHelper.ToUpperCase(Eval("Region.Nombre"))%>,
                    <%# StringHelper.ToUpperCase(Eval("Provincia.Nombre"))%>,
                    <%# StringHelper.ToUpperCase(Eval("Comuna.Nombre"))%>
                </td>
                <td>
                    <a title="Adminstradores" href="ListarUsuarioAdmin.aspx?rut=<%# Eval("Emp_rut") %>">
                        Ver</a>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody> </table>
        </FooterTemplate>
    </asp:Repeater>
    <asp:ObjectDataSource ID="EmpresaDataSource" runat="server" SelectMethod="ListarEmpresas"
        TypeName="Talento21.Negocio.Servicio.SrvEmpresa">
        <SelectParameters>
            <asp:ControlParameter ControlID="RutTextBox" Name="rut" PropertyName="Text" Type="Int32" />
            <asp:ControlParameter ControlID="RazonSocialTextBox" Name="razon" PropertyName="Text"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
